package org.vdab.projects.tasks.shared;

import com.google.gwt.user.client.Random;

public class Utils {
	public static String generateRandomKey(){
		//String.format not available in GWT 
		return generateRandom5DigitHexString() + "-"
				  + generateRandom5DigitHexString() + "-"
				  + generateRandom5DigitHexString() + "-"
				  + generateRandom5DigitHexString();
	} 
	
	private static String generateRandom5DigitHexString(){		
		return (Integer.toString(Random.nextInt(Integer.MAX_VALUE),36)+ "00000").substring(0,5).toUpperCase();
	}	
}
